<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SearchEnlist.ascx.vb" Inherits="WebForm_SelfManageEnlistment_SearchEnlist" %>
<%@ Register Namespace="My" TagPrefix="cc1" %>
<My:MyGridView ID="gv" runat="server" SkinID="pager" AllowHoverSelect="False"  meta:resourcekey="gv"
    AllowHoverEffect="True" MySortDirection="Ascending" DataSourceID="SqlDataSource1"
 AutoGenerateColumns="False" DataKeyNames="applicationID" AllowSorting="True">
    <Columns>
        <asp:BoundField DataField="OrganizationName" meta:resourcekey="bfOrganizationName" SortExpression="OrganizationName" > 
        <HeaderStyle Width="100px" /><ItemStyle Width="100px" />
                </asp:BoundField>
        <asp:BoundField DataField="EnlistName" meta:resourcekey="bfEnlistName" SortExpression="EnlistName" > 
        <HeaderStyle Width="120px" /><ItemStyle Width="120px" />
                </asp:BoundField>
        <asp:BoundField DataField="Description" meta:resourcekey="bfDescription" SortExpression="Description"> 
        <HeaderStyle Width="120px" /><ItemStyle Width="120px" />
                </asp:BoundField>
        <asp:BoundField DataField="StartDate" meta:resourcekey="bfStartDate" SortExpression="StartDate" DataFormatString="{0:yyyy/MM/dd}" ><ItemStyle HorizontalAlign="Center" /> </asp:BoundField>
        <asp:BoundField DataField="EndDate" meta:resourcekey="bfEndDate" SortExpression="EndDate" DataFormatString="{0:yyyy/MM/dd}" ><ItemStyle HorizontalAlign="Center" /> </asp:BoundField>
        <asp:BoundField DataField="PeopleRequired" meta:resourcekey="bfPeopleRequired" SortExpression="PeopleRequired" ><ItemStyle HorizontalAlign="Center" /> </asp:BoundField>
        <asp:BoundField DataField="Text" meta:resourcekey="bfText" SortExpression="Text"><ItemStyle HorizontalAlign="Center" /> </asp:BoundField>
        <asp:TemplateField meta:resourcekey="bfCancel">
        <ItemTemplate>
            <asp:Button runat="server" meta:resourcekey="btnCancel" ID="btnCancel" CommandName="Update"></asp:Button>
                    <asp:HiddenField runat="server" ID="hideStatus" value='<%# Eval("Status") %>'></asp:HiddenField>
        </ItemTemplate>
        <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
    </Columns>
</My:MyGridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>" SelectCommand="SELECT a.applicationID,a.status,b.*, c.Text,d.OrganizationName FROM EnlistRecordApplication AS a INNER JOIN EnlistHeader AS b ON a.EnlistID = b.EnlistID INNER JOIN CodeMapping AS c ON a.Status = c.Value and c.tablename='Form' Join organizationview d on b.UOrganizationID=d.UOrganizationID WHERE (a.Status NOT IN ('RW')) AND a.VolunteerID = @VolunteerID Order by a.CreateDate desc" UpdateCommand="Update EnlistRecordApplication set Status='RW' where applicationID=@applicationID">
    <SelectParameters>
        <asp:Parameter Name="VolunteerID" Type="String" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="applicationID" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>
